$(document).ready(function(){
	(function( $ ){
	
	  $.fn.popup = function(id,content,btnW) {
		  var cw = $(content).width()+btnW;
		  var ch = $(content).height();
		 var ww = ($(window).width()-cw)/2;
		 var wh = $(window).height()/2;
		  $(id).css("left",ww+200);
		  $(id).css("top",wh+200);
		  $(id).css("display","block");
		  
		  $(id).animate({width: cw, height : ch,top: wh-200,left: ww});
		  
	  };
	  $.fn.close = function(id,content,btnW){
		  var cw = $(content).width()+btnW;
		  var ch = $(content).height();
		  var ww = ($(window).width()-cw)/2;
		  var wh = $(window).height()/2;
		  $(id).animate({width: 0, height : 0,top: wh,left: ww},function(){
			  $(id).css("display","none");
		  });		  
	  }
	})( jQuery );
})